//
//  DUSplashView.m
//  APP
//
//  Created by duyujin1 on 2021/8/17.
//

#import "DUSplashView.h"
#import "Masonry.h"

@implementation DUSplashView

-(instancetype)initWithFrame:(CGRect)frame{
    if(self=[super initWithFrame:frame]){
        self.image=[UIImage imageNamed:@"icon.bundle/splash.png"];
        UIButton * button=[[UIButton alloc]initWithFrame:CGRectZero];
        [button setTitle:@"跳过" forState:UIControlStateNormal];
        button.backgroundColor=UIColor.lightGrayColor;
        [button addTarget:self action:@selector(removeSplashView) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:button];
        [button mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(70);
            make.right.mas_equalTo(-20);
            make.width.mas_equalTo(80);
            make.height.mas_equalTo(40);
        }];
        self.userInteractionEnabled=YES;
    }
    return self;
}
-(void)removeSplashView{
    [self removeFromSuperview];
}

@end
